// Package startup
// Created by GoLand
// @User: lenora
// @Date: 2024/8/27
// @Time: 14:51

//go:build wireinject

package startup

import (
	"camp/microbook/interactive/grpc"
	"camp/microbook/interactive/repository"
	"camp/microbook/interactive/repository/cache"
	"camp/microbook/interactive/repository/dao"
	"camp/microbook/interactive/service"
	"github.com/google/wire"
)

var thirdPartySet = wire.NewSet(
	//第三方依赖
	InitDb, InitRedis, InitLogger)

var interactiveSvcSet = wire.NewSet(
	dao.NewGORMInteractiveDAO,
	cache.NewInteractiveRedisCache,
	repository.NewInteractiveRepository,
	service.NewInteractiveService,
)

func InitInteractiveService() *grpc.InteractiveServer {
	wire.Build(
		thirdPartySet,
		interactiveSvcSet,
		grpc.NewInteractiveServer)
	return &grpc.InteractiveServer{}
}
